package com.yys.controller;

import com.yys.service.yysService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.awt.*;

@Controller
public class yysController {

    @Autowired
    private yysService yysService;


    @GetMapping("/yys")
    public String test(){
        return "index";
    }

    @GetMapping("/dr")
    public String dr(){
        return "dr";
    }
    @GetMapping("/sr")
    public String sr(){
        return "sr";
    }

    @PostMapping("/getlocation")
    @ResponseBody
    public String getlocation(int x,int y,int time,int count)  {
      int allcount=  yysService.startone(x,y,time,count);
        String countstr=allcount+"";
        return countstr;
    }


    @PostMapping("/getlocation2")
    @ResponseBody
    public String getlocation2(int x1,int y1,int x2,int y2,int time,int count)  {
        int allcount=  yysService.starttwo(x1,y1,x2,y2,time,count);
        String countstr=allcount+"";
        return countstr;
    }

    @PostMapping("/end")
    @ResponseBody
    public String end()  {
        yysService.end();

        return "success";
    }


    @PostMapping("/end1")
    @ResponseBody
    public String end1()  {
        yysService.end1();

        return "success";
    }




}
